home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-05-19 | 43.8 KB | 2,118 lines |
- #define EXTERN extern
- #include "texd.h"
-
- preparemag () {
- preparemag_regmem
- if ( ( magset > 0 ) && ( eqtb [ 5284 ] .cint != magset ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 405 ) ;
- }
- printint ( eqtb [ 5284 ] .cint ) ;
- print ( 406 ) ;
- printnl ( 407 ) ;
- {
- helpptr = 2 ;
- helpline [ 1 ] = 408 ;
- helpline [ 0 ] = 409 ;
- }
- interror ( magset ) ;
- geqworddefine ( 5284 , magset ) ;
- }
- if ( ( eqtb [ 5284 ] .cint <= 0 ) || ( eqtb [ 5284 ] .cint > 32768L ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 410 ) ;
- }
- {
- helpptr = 1 ;
- helpline [ 0 ] = 411 ;
- }
- interror ( eqtb [ 5284 ] .cint ) ;
- geqworddefine ( 5284 , 1000 ) ;
- }
- magset = eqtb [ 5284 ] .cint ;
- }
- ztokenshow ( p )
- halfword p ;
- {tokenshow_regmem
- if ( p != 0 )
- showtokenlist ( mem [ p ] .hh .v.RH , 0 , 1000 ) ;
- }
- printmeaning () {
- printmeaning_regmem
- printcmdchr ( curcmd , curchr ) ;
- if ( curcmd >= 110 )
- {
- printchar ( 58 ) ;
- println () ;
- tokenshow ( curchr ) ;
- }
- else if ( curcmd == 109 )
- {
- printchar ( 58 ) ;
- println () ;
- tokenshow ( curmark [ curchr ] ) ;
- }
- }
- showcurcmdchr () {
- showcurcmdchr_regmem
- begindiagnostic () ;
- printnl ( 123 ) ;
- if ( curlist .modefield != shownmode )
- {
- printmode ( curlist .modefield ) ;
- print ( 426 ) ;
- shownmode = curlist .modefield ;
- }
- printcmdchr ( curcmd , curchr ) ;
- printchar ( 125 ) ;
- enddiagnostic ( false ) ;
- }
- showcontext () {
- /* 30 */ showcontext_regmem
- schar oldsetting ;
- integer i ;
- integer j ;
- integer l ;
- integer m ;
- integer n ;
- integer p ;
- integer q ;
- baseptr = inputptr ;
- inputstack [ baseptr ] = curinput ;
- while ( true ) {
-
- curinput = inputstack [ baseptr ] ;
- if ( ( baseptr == inputptr ) || ( curinput .statefield != 0 ) || (
- curinput .indexfield != 3 ) || ( curinput .locfield != 0 ) )
- {
- tally = 0 ;
- oldsetting = selector ;
- if ( curinput .statefield != 0 )
- {
- if ( curinput .namefield <= 17 )
- if ( ( curinput .namefield == 0 ) )
- if ( baseptr == 0 )
- printnl ( 432 ) ;
- else printnl ( 433 ) ;
- else {
-
- printnl ( 434 ) ;
- if ( curinput .namefield == 17 )
- printchar ( 42 ) ;
- else printint ( curinput .namefield - 1 ) ;
- printchar ( 62 ) ;
- }
- else {
-
- printnl ( 435 ) ;
- printint ( line ) ;
- }
- printchar ( 32 ) ;
- {
- l = tally ;
- tally = 0 ;
- selector = 20 ;
- trickcount = 1000000L ;
- }
- if ( buffer [ curinput .limitfield ] == eqtb [ 5315 ] .cint )
- j = curinput .limitfield ;
- else j = curinput .limitfield + 1 ;
- if ( j > 0 )
- {register integer for_end; i = curinput .startfield ; for_end = j - 1
- ; if ( i <= for_end) do
- {
- if ( i == curinput .locfield )
- {
- firstcount = tally ;
- trickcount = tally + 1 + errorline - halferrorline ;
- if ( trickcount < errorline )
- trickcount = errorline ;
- }
- print ( buffer [ i ] ) ;
- }
- while ( i++ < for_end ) ; }
- }
- else {
-
- switch ( curinput .indexfield )
- {case 0 :
- printnl ( 436 ) ;
- break ;
- case 1 :
- case 2 :
- printnl ( 437 ) ;
- break ;
- case 3 :
- if ( curinput .locfield == 0 )
- printnl ( 438 ) ;
- else printnl ( 439 ) ;
- break ;
- case 4 :
- printnl ( 440 ) ;
- break ;
- case 5 :
- {
- println () ;
- printcs ( curinput .namefield ) ;
- }
- break ;
- case 6 :
- printnl ( 441 ) ;
- break ;
- case 7 :
- printnl ( 442 ) ;
- break ;
- case 8 :
- printnl ( 443 ) ;
- break ;
- case 9 :
- printnl ( 444 ) ;
- break ;
- case 10 :
- printnl ( 445 ) ;
- break ;
- case 11 :
- printnl ( 446 ) ;
- break ;
- case 12 :
- printnl ( 447 ) ;
- break ;
- case 13 :
- printnl ( 448 ) ;
- break ;
- case 14 :
- printnl ( 449 ) ;
- break ;
- case 15 :
- printnl ( 450 ) ;
- break ;
- default:
- printnl ( 63 ) ;
- break ;
- }
- {
- l = tally ;
- tally = 0 ;
- selector = 20 ;
- trickcount = 1000000L ;
- }
- if ( curinput .indexfield < 5 )
- showtokenlist ( curinput .startfield , curinput .locfield , 100000L )
- ;
- else showtokenlist ( mem [ curinput .startfield ] .hh .v.RH , curinput
- .locfield , 100000L ) ;
- }
- selector = oldsetting ;
- if ( trickcount == 1000000L )
- {
- firstcount = tally ;
- trickcount = tally + 1 + errorline - halferrorline ;
- if ( trickcount < errorline )
- trickcount = errorline ;
- }
- if ( tally < trickcount )
- m = tally - firstcount ;
- else m = trickcount - firstcount ;
- if ( l + firstcount <= halferrorline )
- {
- p = 0 ;
- n = l + firstcount ;
- }
- else {
-
- print ( 146 ) ;
- p = l + firstcount - halferrorline + 3 ;
- n = halferrorline ;
- }
- {register integer for_end; q = p ; for_end = firstcount - 1 ; if ( q <=
- for_end) do
- printchar ( trickbuf [ q % errorline ] ) ;
- while ( q++ < for_end ) ; }
- println () ;
- {register integer for_end; q = 1 ; for_end = n ; if ( q <= for_end) do
- printchar ( 32 ) ;
- while ( q++ < for_end ) ; }
- if ( m + n <= errorline )
- p = firstcount + m ;
- else p = firstcount + ( errorline - n - 3 ) ;
- {register integer for_end; q = firstcount ; for_end = p - 1 ; if ( q <=
- for_end) do
- printchar ( trickbuf [ q % errorline ] ) ;
- while ( q++ < for_end ) ; }
- if ( m + n > errorline )
- print ( 146 ) ;
- }
- if ( ( curinput .statefield != 0 ) )
- if ( ( curinput .namefield > 17 ) || ( baseptr == 0 ) )
- goto lab30 ;
- decr ( baseptr ) ;
- }
- lab30: curinput = inputstack [ inputptr ] ;
- }
- zbegintokenlist ( p , t )
- halfword p ;
- quarterword t ;
- {begintokenlist_regmem
- {
- if ( inputptr > maxinstack )
- {
- maxinstack = inputptr ;
- if ( inputptr == stacksize )
- overflow ( 451 , stacksize ) ;
- }
- inputstack [ inputptr ] = curinput ;
- incr ( inputptr ) ;
- }
- curinput .statefield = 0 ;
- curinput .startfield = p ;
- curinput .indexfield = t ;
- if ( t >= 5 )
- {
- incr ( mem [ p ] .hh .v.LH ) ;
- if ( t == 5 )
- curinput .limitfield = paramptr ;
- else {
-
- curinput .locfield = mem [ p ] .hh .v.RH ;
- if ( eqtb [ 5297 ] .cint > 1 )
- {
- begindiagnostic () ;
- printnl ( 206 ) ;
- switch ( t )
- {case 14 :
- printesc ( 219 ) ;
- break ;
- case 15 :
- printesc ( 452 ) ;
- break ;
- default:
- printcmdchr ( 71 , t + 4051 ) ;
- break ;
- }
- print ( 414 ) ;
- tokenshow ( p ) ;
- enddiagnostic ( false ) ;
- }
- }
- }
- else curinput .locfield = p ;
- }
- endtokenlist () {
- endtokenlist_regmem
- if ( curinput .indexfield >= 3 )
- {
- if ( curinput .indexfield <= 4 )
- flushlist ( curinput .startfield ) ;
- else {
-
- deletetokenref ( curinput .startfield ) ;
- if ( curinput .indexfield == 5 )
- while ( paramptr > curinput .limitfield ) {
-
- decr ( paramptr ) ;
- flushlist ( paramstack [ paramptr ] ) ;
- }
- }
- }
- else if ( curinput .indexfield == 1 )
- alignstate = 0 ;
- {
- decr ( inputptr ) ;
- curinput = inputstack [ inputptr ] ;
- }
- {
- if ( interrupt != 0 )
- pauseforinstructions () ;
- }
- }
- backinput () {
- backinput_regmem
- halfword p ;
- while ( ( curinput .statefield == 0 ) && ( curinput .locfield == 0 ) )
- endtokenlist () ;
- p = getavail () ;
- mem [ p ] .hh .v.LH = curtok ;
- if ( curtok < 768 )
- if ( curtok < 512 )
- decr ( alignstate ) ;
- else incr ( alignstate ) ;
- {
- if ( inputptr > maxinstack )
- {
- maxinstack = inputptr ;
- if ( inputptr == stacksize )
- overflow ( 451 , stacksize ) ;
- }
- inputstack [ inputptr ] = curinput ;
- incr ( inputptr ) ;
- }
- curinput .statefield = 0 ;
- curinput .startfield = p ;
- curinput .indexfield = 3 ;
- curinput .locfield = p ;
- }
- backerror () {
- backerror_regmem
- OKtointerrupt = false ;
- backinput () ;
- OKtointerrupt = true ;
- error () ;
- }
- inserror () {
- inserror_regmem
- OKtointerrupt = false ;
- backinput () ;
- curinput .indexfield = 4 ;
- OKtointerrupt = true ;
- error () ;
- }
- beginfilereading () {
- beginfilereading_regmem
- if ( inopen == maxinopen )
- overflow ( 453 , maxinopen ) ;
- if ( first == bufsize )
- overflow ( 454 , bufsize ) ;
- incr ( inopen ) ;
- {
- if ( inputptr > maxinstack )
- {
- maxinstack = inputptr ;
- if ( inputptr == stacksize )
- overflow ( 451 , stacksize ) ;
- }
- inputstack [ inputptr ] = curinput ;
- incr ( inputptr ) ;
- }
- curinput .indexfield = inopen ;
- linestack [ curinput .indexfield ] = line ;
- curinput .startfield = first ;
- curinput .statefield = 1 ;
- curinput .namefield = 0 ;
- }
- endfilereading () {
- endfilereading_regmem
- first = curinput .startfield ;
- line = linestack [ curinput .indexfield ] ;
- if ( curinput .namefield > 17 )
- aclose ( inputfile [ curinput .indexfield ] ) ;
- {
- decr ( inputptr ) ;
- curinput = inputstack [ inputptr ] ;
- }
- decr ( inopen ) ;
- }
- clearforerrorprompt () {
- clearforerrorprompt_regmem
- while ( ( curinput .statefield != 0 ) && ( curinput .namefield == 0 ) && (
- inputptr > 0 ) && ( curinput .locfield > curinput .limitfield ) )
- endfilereading () ;
- println () ;
- clearterminal () ;
- }
- checkoutervalidity () {
- checkoutervalidity_regmem
- halfword p ;
- halfword q ;
- if ( scannerstatus != 0 )
- {
- deletionsallowed = false ;
- if ( curcs != 0 )
- {
- if ( ( curinput .statefield == 0 ) || ( curinput .namefield < 1 ) || (
- curinput .namefield > 17 ) )
- {
- p = getavail () ;
- mem [ p ] .hh .v.LH = 4096 + curcs ;
- begintokenlist ( p , 3 ) ;
- }
- curcmd = 10 ;
- curchr = 32 ;
- }
- if ( scannerstatus > 1 )
- {
- runaway () ;
- if ( curcs == 0 )
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 462 ) ;
- }
- else {
-
- curcs = 0 ;
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 463 ) ;
- }
- }
- print ( 464 ) ;
- p = getavail () ;
- switch ( scannerstatus )
- {case 2 :
- {
- print ( 428 ) ;
- mem [ p ] .hh .v.LH = 637 ;
- }
- break ;
- case 3 :
- {
- print ( 470 ) ;
- mem [ p ] .hh .v.LH = partoken ;
- longstate = 112 ;
- }
- break ;
- case 4 :
- {
- print ( 430 ) ;
- mem [ p ] .hh .v.LH = 637 ;
- q = p ;
- p = getavail () ;
- mem [ p ] .hh .v.RH = q ;
- mem [ p ] .hh .v.LH = 7355 ;
- alignstate = -1000000L ;
- }
- break ;
- case 5 :
- {
- print ( 431 ) ;
- mem [ p ] .hh .v.LH = 637 ;
- }
- break ;
- }
- begintokenlist ( p , 4 ) ;
- print ( 465 ) ;
- sprintcs ( warningindex ) ;
- {
- helpptr = 4 ;
- helpline [ 3 ] = 466 ;
- helpline [ 2 ] = 467 ;
- helpline [ 1 ] = 468 ;
- helpline [ 0 ] = 469 ;
- }
- error () ;
- }
- else {
-
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 456 ) ;
- }
- printcmdchr ( 104 , curif ) ;
- print ( 457 ) ;
- printint ( skipline ) ;
- {
- helpptr = 3 ;
- helpline [ 2 ] = 458 ;
- helpline [ 1 ] = 459 ;
- helpline [ 0 ] = 460 ;
- }
- if ( curcs != 0 )
- curcs = 0 ;
- else helpline [ 2 ] = 461 ;
- curtok = 7358 ;
- inserror () ;
- }
- deletionsallowed = true ;
- }
- }
- getnext () {
- /* 20 25 21 26 40 10 */ getnext_regmem
- integer k ;
- halfword t ;
- schar cat ;
- lab20: curcs = 0 ;
- if ( curinput .statefield != 0 )
- {
- lab25: if ( curinput .locfield <= curinput .limitfield )
- {
- curchr = buffer [ curinput .locfield ] ;
- incr ( curinput .locfield ) ;
- lab21: curcmd = eqtb [ 4627 + curchr ] .hh .v.RH ;
- switch ( curinput .statefield + curcmd )
- {case 10 :
- case 26 :
- case 42 :
- case 27 :
- case 43 :
- goto lab25 ;
- break ;
- case 1 :
- case 17 :
- case 33 :
- {
- if ( curinput .locfield > curinput .limitfield )
- curcs = 257 ;
- else {
-
- lab26: k = curinput .locfield ;
- curchr = buffer [ k ] ;
- cat = eqtb [ 4627 + curchr ] .hh .v.RH ;
- incr ( k ) ;
- if ( cat == 11 )
- curinput .statefield = 17 ;
- else if ( cat == 10 )
- curinput .statefield = 17 ;
- else curinput .statefield = 1 ;
- if ( ( cat == 11 ) && ( k <= curinput .limitfield ) )
- {
- do {
- curchr = buffer [ k ] ;
- cat = eqtb [ 4627 + curchr ] .hh .v.RH ;
- incr ( k ) ;
- } while ( ! ( ( cat != 11 ) || ( k > curinput .limitfield ) ) )
- ;
- {
- if ( buffer [ k ] == curchr )
- if ( cat == 7 )
- if ( k < curinput .limitfield )
- {
- curchr = buffer [ k + 1 ] ;
- if ( curchr < 64 )
- buffer [ k - 1 ] = curchr + 64 ;
- else buffer [ k - 1 ] = curchr - 64 ;
- curinput .limitfield = curinput .limitfield - 2 ;
- first = first - 2 ;
- while ( k <= curinput .limitfield ) {
-
- buffer [ k ] = buffer [ k + 2 ] ;
- incr ( k ) ;
- }
- goto lab26 ;
- }
- }
- if ( cat != 11 )
- decr ( k ) ;
- if ( k > curinput .locfield + 1 )
- {
- curcs = idlookup ( curinput .locfield , k - curinput .locfield
- ) ;
- curinput .locfield = k ;
- goto lab40 ;
- }
- }
- else {
-
- if ( buffer [ k ] == curchr )
- if ( cat == 7 )
- if ( k < curinput .limitfield )
- {
- curchr = buffer [ k + 1 ] ;
- if ( curchr < 64 )
- buffer [ k - 1 ] = curchr + 64 ;
- else buffer [ k - 1 ] = curchr - 64 ;
- curinput .limitfield = curinput .limitfield - 2 ;
- first = first - 2 ;
- while ( k <= curinput .limitfield ) {
-
- buffer [ k ] = buffer [ k + 2 ] ;
- incr ( k ) ;
- }
- goto lab26 ;
- }
- }
- curcs = 129 + buffer [ curinput .locfield ] ;
- incr ( curinput .locfield ) ;
- }
- lab40: curcmd = eqtb [ curcs ] .hh.b0 ;
- curchr = eqtb [ curcs ] .hh .v.RH ;
- if ( curcmd >= 112 )
- checkoutervalidity () ;
- }
- break ;
- case 14 :
- case 30 :
- case 46 :
- {
- curcs = curchr + 1 ;
- curcmd = eqtb [ curcs ] .hh.b0 ;
- curchr = eqtb [ curcs ] .hh .v.RH ;
- curinput .statefield = 1 ;
- if ( curcmd >= 112 )
- checkoutervalidity () ;
- }
- break ;
- case 8 :
- case 24 :
- case 40 :
- {
- if ( ( curchr == buffer [ curinput .locfield ] ) && ( curinput
- .locfield < curinput .limitfield ) )
- {
- if ( buffer [ curinput .locfield + 1 ] < 64 )
- curchr = buffer [ curinput .locfield + 1 ] + 64 ;
- else curchr = buffer [ curinput .locfield + 1 ] - 64 ;
- curinput .locfield = curinput .locfield + 2 ;
- goto lab21 ;
- }
- curinput .statefield = 1 ;
- }
- break ;
- case 16 :
- case 32 :
- case 48 :
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 471 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 472 ;
- helpline [ 0 ] = 473 ;
- }
- deletionsallowed = false ;
- error () ;
- deletionsallowed = true ;
- goto lab20 ;
- }
- break ;
- case 11 :
- {
- curinput .statefield = 17 ;
- curchr = 32 ;
- }
- break ;
- case 6 :
- {
- curinput .locfield = curinput .limitfield + 1 ;
- curcmd = 10 ;
- curchr = 32 ;
- }
- break ;
- case 22 :
- case 15 :
- case 31 :
- case 47 :
- {
- curinput .locfield = curinput .limitfield + 1 ;
- goto lab25 ;
- }
- break ;
- case 38 :
- {
- curinput .locfield = curinput .limitfield + 1 ;
- curcs = parloc ;
- curcmd = eqtb [ curcs ] .hh.b0 ;
- curchr = eqtb [ curcs ] .hh .v.RH ;
- if ( curcmd >= 112 )
- checkoutervalidity () ;
- }
- break ;
- case 2 :
- incr ( alignstate ) ;
- break ;
- case 18 :
- case 34 :
- {
- curinput .statefield = 1 ;
- incr ( alignstate ) ;
- }
- break ;
- case 3 :
- decr ( alignstate ) ;
- break ;
- case 19 :
- case 35 :
- {
- curinput .statefield = 1 ;
- decr ( alignstate ) ;
- }
- break ;
- case 20 :
- case 21 :
- case 23 :
- case 25 :
- case 28 :
- case 29 :
- case 36 :
- case 37 :
- case 39 :
- case 41 :
- case 44 :
- case 45 :
- curinput .statefield = 1 ;
- break ;
- default:
- ;
- break ;
- }
- }
- else {
-
- curinput .statefield = 33 ;
- if ( curinput .namefield > 17 )
- {
- incr ( line ) ;
- first = curinput .startfield ;
- if ( ! forceeof )
- {
- if ( inputln ( inputfile [ curinput .indexfield ] , true ) )
- firmuptheline () ;
- else forceeof = true ;
- }
- if ( forceeof )
- {
- printchar ( 41 ) ;
- forceeof = false ;
- termflush ( stdout ) ;
- endfilereading () ;
- checkoutervalidity () ;
- goto lab20 ;
- }
- if ( ( eqtb [ 5315 ] .cint < 0 ) || ( eqtb [ 5315 ] .cint > 127 ) )
- decr ( curinput .limitfield ) ;
- else buffer [ curinput .limitfield ] = eqtb [ 5315 ] .cint ;
- first = curinput .limitfield + 1 ;
- curinput .locfield = curinput .startfield ;
- }
- else {
-
- if ( ! ( curinput .namefield == 0 ) )
- {
- curcmd = 0 ;
- curchr = 0 ;
- return ;
- }
- if ( inputptr > 0 )
- {
- endfilereading () ;
- goto lab20 ;
- }
- if ( selector < 18 )
- openlogfile () ;
- if ( interaction > 1 )
- {
- if ( ( eqtb [ 5315 ] .cint < 0 ) || ( eqtb [ 5315 ] .cint > 127 ) )
- incr ( curinput .limitfield ) ;
- if ( curinput .limitfield == curinput .startfield )
- printnl ( 474 ) ;
- println () ;
- first = curinput .startfield ;
- {
- wakeupterminal () ;
- print ( 42 ) ;
- terminput () ;
- }
- curinput .limitfield = last ;
- if ( ( eqtb [ 5315 ] .cint < 0 ) || ( eqtb [ 5315 ] .cint > 127 ) )
- decr ( curinput .limitfield ) ;
- else buffer [ curinput .limitfield ] = eqtb [ 5315 ] .cint ;
- first = curinput .limitfield + 1 ;
- curinput .locfield = curinput .startfield ;
- }
- else fatalerror ( 475 ) ;
- }
- {
- if ( interrupt != 0 )
- pauseforinstructions () ;
- }
- goto lab25 ;
- }
- }
- else if ( curinput .locfield != 0 )
- {
- t = mem [ curinput .locfield ] .hh .v.LH ;
- curinput .locfield = mem [ curinput .locfield ] .hh .v.RH ;
- if ( t >= 4096 )
- {
- curcs = t - 4096 ;
- curcmd = eqtb [ curcs ] .hh.b0 ;
- curchr = eqtb [ curcs ] .hh .v.RH ;
- if ( curcmd >= 112 )
- if ( curcmd == 115 )
- {
- curcs = mem [ curinput .locfield ] .hh .v.LH - 4096 ;
- curinput .locfield = 0 ;
- curcmd = eqtb [ curcs ] .hh.b0 ;
- curchr = eqtb [ curcs ] .hh .v.RH ;
- if ( curcmd > 99 )
- {
- curcmd = 0 ;
- curchr = 257 ;
- }
- }
- else checkoutervalidity () ;
- }
- else {
-
- curcmd = t / 256 ;
- curchr = t % 256 ;
- switch ( curcmd )
- {case 1 :
- incr ( alignstate ) ;
- break ;
- case 2 :
- decr ( alignstate ) ;
- break ;
- case 5 :
- {
- begintokenlist ( paramstack [ curinput .limitfield + curchr - 1 ] ,
- 0 ) ;
- goto lab20 ;
- }
- break ;
- default:
- ;
- break ;
- }
- }
- }
- else {
-
- endtokenlist () ;
- goto lab20 ;
- }
- if ( curcmd <= 5 )
- if ( curcmd >= 4 )
- if ( alignstate == 0 )
- {
- if ( scannerstatus == 4 )
- fatalerror ( 762 ) ;
- curcmd = mem [ curalign + 5 ] .hh .v.LH ;
- mem [ curalign + 5 ] .hh .v.LH = curchr ;
- if ( curcmd == 63 )
- begintokenlist ( memtop - 10 , 2 ) ;
- else begintokenlist ( mem [ curalign + 2 ] .cint , 2 ) ;
- alignstate = 1000000L ;
- goto lab20 ;
- }
- }
- firmuptheline () {
- firmuptheline_regmem
- integer k ;
- curinput .limitfield = last ;
- if ( eqtb [ 5295 ] .cint > 0 )
- if ( interaction > 1 )
- {
- wakeupterminal () ;
- println () ;
- if ( curinput .startfield < curinput .limitfield )
- {register integer for_end; k = curinput .startfield ; for_end = curinput
- .limitfield - 1 ; if ( k <= for_end) do
- print ( buffer [ k ] ) ;
- while ( k++ < for_end ) ; }
- first = curinput .limitfield ;
- {
- wakeupterminal () ;
- print ( 476 ) ;
- terminput () ;
- }
- if ( last > first )
- {
- {register integer for_end; k = first ; for_end = last - 1 ; if ( k <=
- for_end) do
- buffer [ k + curinput .startfield - first ] = buffer [ k ] ;
- while ( k++ < for_end ) ; }
- curinput .limitfield = curinput .startfield + last - first ;
- }
- }
- }
- gettoken () {
- gettoken_regmem
- nonewcontrolsequence = false ;
- getnext () ;
- nonewcontrolsequence = true ;
- if ( curcs == 0 )
- curtok = ( curcmd * 256 ) + curchr ;
- else curtok = 4096 + curcs ;
- }
- macrocall () {
- /* 10 22 30 31 40 */ macrocall_regmem
- halfword r ;
- halfword p ;
- halfword q ;
- halfword s ;
- halfword t ;
- halfword u, v ;
- halfword rbraceptr ;
- smallnumber n ;
- halfword unbalance ;
- halfword m ;
- halfword refcount ;
- smallnumber savescannerstatus ;
- halfword savewarningindex ;
- ASCIIcode matchchr ;
- savescannerstatus = scannerstatus ;
- savewarningindex = warningindex ;
- warningindex = curcs ;
- refcount = curchr ;
- r = mem [ refcount ] .hh .v.RH ;
- n = 0 ;
- if ( eqtb [ 5297 ] .cint > 0 )
- {
- begindiagnostic () ;
- println () ;
- printcs ( warningindex ) ;
- tokenshow ( refcount ) ;
- enddiagnostic ( false ) ;
- }
- if ( mem [ r ] .hh .v.LH != 3584 )
- {
- scannerstatus = 3 ;
- unbalance = 0 ;
- longstate = eqtb [ curcs ] .hh.b0 ;
- if ( longstate >= 112 )
- longstate = longstate - 2 ;
- do {
- if ( ( mem [ r ] .hh .v.LH > 3455 ) || ( mem [ r ] .hh .v.LH < 3328 )
- )
- s = 0 ;
- else {
-
- matchchr = mem [ r ] .hh .v.LH - 3328 ;
- s = mem [ r ] .hh .v.RH ;
- r = s ;
- p = memtop - 3 ;
- mem [ p ] .hh .v.RH = 0 ;
- m = 0 ;
- }
- lab22: gettoken () ;
- if ( curtok == mem [ r ] .hh .v.LH )
- {
- r = mem [ r ] .hh .v.RH ;
- if ( ( mem [ r ] .hh .v.LH >= 3328 ) && ( mem [ r ] .hh .v.LH <= 3584
- ) )
- {
- if ( curtok < 512 )
- decr ( alignstate ) ;
- goto lab40 ;
- }
- else goto lab22 ;
- }
- if ( s != r )
- if ( s == 0 )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 508 ) ;
- }
- sprintcs ( warningindex ) ;
- print ( 509 ) ;
- {
- helpptr = 4 ;
- helpline [ 3 ] = 510 ;
- helpline [ 2 ] = 511 ;
- helpline [ 1 ] = 512 ;
- helpline [ 0 ] = 513 ;
- }
- error () ;
- goto lab10 ;
- }
- else {
-
- t = s ;
- do {
- {
- q = getavail () ;
- mem [ p ] .hh .v.RH = q ;
- mem [ q ] .hh .v.LH = mem [ t ] .hh .v.LH ;
- p = q ;
- }
- incr ( m ) ;
- u = mem [ t ] .hh .v.RH ;
- v = s ;
- while ( true ) {
-
- if ( u == r )
- if ( curtok != mem [ v ] .hh .v.LH )
- goto lab30 ;
- else {
-
- r = mem [ v ] .hh .v.RH ;
- goto lab22 ;
- }
- if ( mem [ u ] .hh .v.LH != mem [ v ] .hh .v.LH )
- goto lab30 ;
- u = mem [ u ] .hh .v.RH ;
- v = mem [ v ] .hh .v.RH ;
- }
- lab30: t = mem [ t ] .hh .v.RH ;
- } while ( ! ( t == r ) ) ;
- r = s ;
- }
- if ( curtok == partoken )
- if ( longstate != 111 )
- {
- if ( longstate == 110 )
- {
- runaway () ;
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 503 ) ;
- }
- sprintcs ( warningindex ) ;
- print ( 504 ) ;
- {
- helpptr = 3 ;
- helpline [ 2 ] = 505 ;
- helpline [ 1 ] = 506 ;
- helpline [ 0 ] = 507 ;
- }
- backerror () ;
- }
- pstack [ n ] = mem [ memtop - 3 ] .hh .v.RH ;
- alignstate = alignstate - unbalance ;
- {register integer for_end; m = 0 ; for_end = n ; if ( m <= for_end)
- do
- flushlist ( pstack [ m ] ) ;
- while ( m++ < for_end ) ; }
- goto lab10 ;
- }
- if ( curtok < 768 )
- if ( curtok < 512 )
- {
- unbalance = 1 ;
- while ( true ) {
-
- {
- {
- q = avail ;
- if ( q == 0 )
- q = getavail () ;
- else {
-
- avail = mem [ q ] .hh .v.RH ;
- mem [ q ] .hh .v.RH = 0 ;
- ;
- #ifdef STAT
- incr ( dynused ) ;
- #endif /* STAT */
- }
- }
- mem [ p ] .hh .v.RH = q ;
- mem [ q ] .hh .v.LH = curtok ;
- p = q ;
- }
- gettoken () ;
- if ( curtok == partoken )
- if ( longstate != 111 )
- {
- if ( longstate == 110 )
- {
- runaway () ;
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 503 ) ;
- }
- sprintcs ( warningindex ) ;
- print ( 504 ) ;
- {
- helpptr = 3 ;
- helpline [ 2 ] = 505 ;
- helpline [ 1 ] = 506 ;
- helpline [ 0 ] = 507 ;
- }
- backerror () ;
- }
- pstack [ n ] = mem [ memtop - 3 ] .hh .v.RH ;
- alignstate = alignstate - unbalance ;
- {register integer for_end; m = 0 ; for_end = n ; if ( m <=
- for_end) do
- flushlist ( pstack [ m ] ) ;
- while ( m++ < for_end ) ; }
- goto lab10 ;
- }
- if ( curtok < 768 )
- if ( curtok < 512 )
- incr ( unbalance ) ;
- else {
-
- decr ( unbalance ) ;
- if ( unbalance == 0 )
- goto lab31 ;
- }
- }
- lab31: rbraceptr = p ;
- {
- q = getavail () ;
- mem [ p ] .hh .v.RH = q ;
- mem [ q ] .hh .v.LH = curtok ;
- p = q ;
- }
- }
- else {
-
- backinput () ;
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 495 ) ;
- }
- sprintcs ( warningindex ) ;
- print ( 496 ) ;
- {
- helpptr = 6 ;
- helpline [ 5 ] = 497 ;
- helpline [ 4 ] = 498 ;
- helpline [ 3 ] = 499 ;
- helpline [ 2 ] = 500 ;
- helpline [ 1 ] = 501 ;
- helpline [ 0 ] = 502 ;
- }
- incr ( alignstate ) ;
- longstate = 110 ;
- curtok = partoken ;
- inserror () ;
- }
- else {
-
- if ( curtok == 2592 )
- if ( mem [ r ] .hh .v.LH <= 3584 )
- if ( mem [ r ] .hh .v.LH >= 3328 )
- goto lab22 ;
- {
- q = getavail () ;
- mem [ p ] .hh .v.RH = q ;
- mem [ q ] .hh .v.LH = curtok ;
- p = q ;
- }
- }
- incr ( m ) ;
- if ( mem [ r ] .hh .v.LH > 3584 )
- goto lab22 ;
- if ( mem [ r ] .hh .v.LH < 3328 )
- goto lab22 ;
- lab40: if ( s != 0 )
- {
- if ( ( m == 1 ) && ( mem [ p ] .hh .v.LH < 768 ) && ( p != memtop - 3
- ) )
- {
- mem [ rbraceptr ] .hh .v.RH = 0 ;
- {
- mem [ p ] .hh .v.RH = avail ;
- avail = p ;
- ;
- #ifdef STAT
- decr ( dynused ) ;
- #endif /* STAT */
- }
- p = mem [ memtop - 3 ] .hh .v.RH ;
- pstack [ n ] = mem [ p ] .hh .v.RH ;
- {
- mem [ p ] .hh .v.RH = avail ;
- avail = p ;
- ;
- #ifdef STAT
- decr ( dynused ) ;
- #endif /* STAT */
- }
- }
- else pstack [ n ] = mem [ memtop - 3 ] .hh .v.RH ;
- incr ( n ) ;
- if ( eqtb [ 5297 ] .cint > 0 )
- {
- begindiagnostic () ;
- printnl ( matchchr ) ;
- printint ( n ) ;
- print ( 514 ) ;
- showtokenlist ( pstack [ n - 1 ] , 0 , 1000 ) ;
- enddiagnostic ( false ) ;
- }
- }
- } while ( ! ( mem [ r ] .hh .v.LH == 3584 ) ) ;
- }
- while ( ( curinput .statefield == 0 ) && ( curinput .locfield == 0 ) )
- endtokenlist () ;
- begintokenlist ( refcount , 5 ) ;
- curinput .namefield = warningindex ;
- curinput .locfield = mem [ r ] .hh .v.RH ;
- if ( n > 0 )
- {
- if ( paramptr + n > maxparamstack )
- {
- maxparamstack = paramptr + n ;
- if ( maxparamstack > paramsize )
- overflow ( 494 , paramsize ) ;
- }
- {register integer for_end; m = 0 ; for_end = n - 1 ; if ( m <= for_end)
- do
- paramstack [ paramptr + m ] = pstack [ m ] ;
- while ( m++ < for_end ) ; }
- paramptr = paramptr + n ;
- }
- lab10: scannerstatus = savescannerstatus ;
- warningindex = savewarningindex ;
- }
- insertrelax () {
- insertrelax_regmem
- curtok = 4096 + curcs ;
- backinput () ;
- curtok = 7361 ;
- backinput () ;
- curinput .indexfield = 4 ;
- }
- expand () {
- expand_regmem
- halfword t ;
- halfword p, q, r ;
- integer j ;
- integer cvbackup ;
- smallnumber cvlbackup, radixbackup, cobackup ;
- halfword backupbackup ;
- smallnumber savescannerstatus ;
- cvbackup = curval ;
- cvlbackup = curvallevel ;
- radixbackup = radix ;
- cobackup = curorder ;
- backupbackup = mem [ memtop - 13 ] .hh .v.RH ;
- if ( curcmd < 110 )
- {
- if ( eqtb [ 5303 ] .cint > 1 )
- showcurcmdchr () ;
- switch ( curcmd )
- {case 109 :
- {
- if ( curmark [ curchr ] != 0 )
- begintokenlist ( curmark [ curchr ] , 14 ) ;
- }
- break ;
- case 101 :
- {
- gettoken () ;
- t = curtok ;
- gettoken () ;
- if ( curcmd > 99 )
- expand () ;
- else backinput () ;
- curtok = t ;
- backinput () ;
- }
- break ;
- case 102 :
- {
- savescannerstatus = scannerstatus ;
- scannerstatus = 0 ;
- gettoken () ;
- scannerstatus = savescannerstatus ;
- t = curtok ;
- backinput () ;
- if ( t >= 4096 )
- {
- p = getavail () ;
- mem [ p ] .hh .v.LH = 7363 ;
- mem [ p ] .hh .v.RH = curinput .locfield ;
- curinput .startfield = p ;
- curinput .locfield = p ;
- }
- }
- break ;
- case 106 :
- {
- r = getavail () ;
- p = r ;
- do {
- getxtoken () ;
- if ( curcs == 0 )
- {
- q = getavail () ;
- mem [ p ] .hh .v.RH = q ;
- mem [ q ] .hh .v.LH = curtok ;
- p = q ;
- }
- } while ( ! ( curcs != 0 ) ) ;
- if ( curcmd != 66 )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 483 ) ;
- }
- printesc ( 364 ) ;
- print ( 484 ) ;
- {
- helpptr = 2 ;
- helpline [ 1 ] = 485 ;
- helpline [ 0 ] = 486 ;
- }
- backerror () ;
- }
- j = first ;
- p = mem [ r ] .hh .v.RH ;
- while ( p != 0 ) {
-
- if ( j >= maxbufstack )
- {
- maxbufstack = j + 1 ;
- if ( maxbufstack == bufsize )
- overflow ( 454 , bufsize ) ;
- }
- buffer [ j ] = mem [ p ] .hh .v.LH % 256 ;
- incr ( j ) ;
- p = mem [ p ] .hh .v.RH ;
- }
- if ( j > first + 1 )
- {
- nonewcontrolsequence = false ;
- curcs = idlookup ( first , j - first ) ;
- nonewcontrolsequence = true ;
- }
- else if ( j == first )
- curcs = 257 ;
- else curcs = 129 + buffer [ first ] ;
- flushlist ( r ) ;
- if ( eqtb [ curcs ] .hh.b0 == 100 )
- {
- eqdefine ( curcs , 0 , 256 ) ;
- }
- curtok = curcs + 4096 ;
- backinput () ;
- }
- break ;
- case 107 :
- convtoks () ;
- break ;
- case 108 :
- insthetoks () ;
- break ;
- case 104 :
- conditional () ;
- break ;
- case 105 :
- if ( curchr > iflimit )
- if ( iflimit == 1 )
- insertrelax () ;
- else {
-
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 633 ) ;
- }
- printcmdchr ( 105 , curchr ) ;
- {
- helpptr = 1 ;
- helpline [ 0 ] = 634 ;
- }
- error () ;
- }
- else {
-
- while ( curchr != 2 ) passtext () ;
- {
- p = condptr ;
- ifline = mem [ p + 1 ] .cint ;
- curif = mem [ p ] .hh.b1 ;
- iflimit = mem [ p ] .hh.b0 ;
- condptr = mem [ p ] .hh .v.RH ;
- freenode ( p , 2 ) ;
- }
- }
- break ;
- case 103 :
- if ( curchr > 0 )
- forceeof = true ;
- else if ( nameinprogress )
- insertrelax () ;
- else startinput () ;
- break ;
- default:
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 477 ) ;
- }
- {
- helpptr = 5 ;
- helpline [ 4 ] = 478 ;
- helpline [ 3 ] = 479 ;
- helpline [ 2 ] = 480 ;
- helpline [ 1 ] = 481 ;
- helpline [ 0 ] = 482 ;
- }
- error () ;
- }
- break ;
- }
- }
- else if ( curcmd < 114 )
- macrocall () ;
- else {
-
- curtok = 7360 ;
- backinput () ;
- }
- curval = cvbackup ;
- curvallevel = cvlbackup ;
- radix = radixbackup ;
- curorder = cobackup ;
- mem [ memtop - 13 ] .hh .v.RH = backupbackup ;
- }
- getxtoken () {
- /* 20 30 */ getxtoken_regmem
- lab20: getnext () ;
- if ( curcmd <= 99 )
- goto lab30 ;
- if ( curcmd >= 110 )
- if ( curcmd < 114 )
- macrocall () ;
- else {
-
- curcs = 3264 ;
- curcmd = 9 ;
- goto lab30 ;
- }
- else expand () ;
- goto lab20 ;
- lab30: if ( curcs == 0 )
- curtok = ( curcmd * 256 ) + curchr ;
- else curtok = 4096 + curcs ;
- }
- xtoken () {
- xtoken_regmem
- while ( curcmd > 99 ) {
-
- expand () ;
- getnext () ;
- }
- if ( curcs == 0 )
- curtok = ( curcmd * 256 ) + curchr ;
- else curtok = 4096 + curcs ;
- }
- scanleftbrace () {
- scanleftbrace_regmem
- do {
- getxtoken () ;
- } while ( ! ( ( curcmd != 10 ) && ( curcmd != 0 ) ) ) ;
- if ( curcmd != 1 )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 515 ) ;
- }
- {
- helpptr = 4 ;
- helpline [ 3 ] = 516 ;
- helpline [ 2 ] = 517 ;
- helpline [ 1 ] = 518 ;
- helpline [ 0 ] = 519 ;
- }
- backerror () ;
- curtok = 379 ;
- curcmd = 1 ;
- curchr = 123 ;
- incr ( alignstate ) ;
- }
- }
- scanoptionalequals () {
- scanoptionalequals_regmem
- do {
- getxtoken () ;
- } while ( ! ( curcmd != 10 ) ) ;
- if ( curtok != 3133 )
- backinput () ;
- }
- boolean zscankeyword ( s )
- strnumber s ;
- {/* 10 */ register boolean Result; scankeyword_regmem
- halfword p ;
- halfword q ;
- poolpointer k ;
- p = memtop - 13 ;
- mem [ p ] .hh .v.RH = 0 ;
- k = strstart [ s ] ;
- while ( k < strstart [ s + 1 ] ) {
-
- getxtoken () ;
- if ( ( curcs == 0 ) && ( ( curchr == strpool [ k ] ) || ( curchr ==
- strpool [ k ] - 32 ) ) )
- {
- {
- q = getavail () ;
- mem [ p ] .hh .v.RH = q ;
- mem [ q ] .hh .v.LH = curtok ;
- p = q ;
- }
- incr ( k ) ;
- }
- else if ( ( curcmd != 10 ) || ( p != memtop - 13 ) )
- {
- backinput () ;
- if ( p != memtop - 13 )
- begintokenlist ( mem [ memtop - 13 ] .hh .v.RH , 3 ) ;
- Result = false ;
- return(Result) ;
- }
- }
- flushlist ( mem [ memtop - 13 ] .hh .v.RH ) ;
- Result = true ;
- return(Result) ;
- }
- muerror () {
- muerror_regmem
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 520 ) ;
- }
- {
- helpptr = 1 ;
- helpline [ 0 ] = 521 ;
- }
- error () ;
- }
- scansevenbitint () {
- scansevenbitint_regmem
- scanint () ;
- if ( ( curval < 0 ) || ( curval > 127 ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 543 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 544 ;
- helpline [ 0 ] = 545 ;
- }
- interror ( curval ) ;
- curval = 0 ;
- }
- }
- scaneightbitint () {
- scaneightbitint_regmem
- scanint () ;
- if ( ( curval < 0 ) || ( curval > 255 ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 546 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 547 ;
- helpline [ 0 ] = 545 ;
- }
- interror ( curval ) ;
- curval = 0 ;
- }
- }
- scanfourbitint () {
- scanfourbitint_regmem
- scanint () ;
- if ( ( curval < 0 ) || ( curval > 15 ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 548 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 549 ;
- helpline [ 0 ] = 545 ;
- }
- interror ( curval ) ;
- curval = 0 ;
- }
- }
- scancharnum () {
- scancharnum_regmem
- scanint () ;
- if ( ( curval < 0 ) || ( curval > 255 ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 543 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 550 ;
- helpline [ 0 ] = 545 ;
- }
- interror ( curval ) ;
- curval = 0 ;
- }
- }
- scanfifteenbitint () {
- scanfifteenbitint_regmem
- scanint () ;
- if ( ( curval < 0 ) || ( curval > 32767 ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 551 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 552 ;
- helpline [ 0 ] = 545 ;
- }
- interror ( curval ) ;
- curval = 0 ;
- }
- }
- scantwentysevenbitin () {
- scantwentysevenbitin_regmem
- scanint () ;
- if ( ( curval < 0 ) || ( curval > 134217727L ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 553 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 554 ;
- helpline [ 0 ] = 545 ;
- }
- interror ( curval ) ;
- curval = 0 ;
- }
- }
- scanfontident () {
- scanfontident_regmem
- internalfontnumber f ;
- halfword m ;
- do {
- getxtoken () ;
- } while ( ! ( curcmd != 10 ) ) ;
- if ( curcmd == 87 )
- f = eqtb [ 4578 ] .hh .v.RH ;
- else if ( curcmd == 86 )
- f = curchr ;
- else if ( curcmd == 85 )
- {
- m = curchr ;
- scanfourbitint () ;
- f = eqtb [ m + curval ] .hh .v.RH ;
- }
- else {
-
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 670 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 671 ;
- helpline [ 0 ] = 672 ;
- }
- backerror () ;
- f = 0 ;
- }
- curval = f ;
- }
- zfindfontdimen ( writing )
- boolean writing ;
- {findfontdimen_regmem
- internalfontnumber f ;
- integer n ;
- scanint () ;
- n = curval ;
- scanfontident () ;
- f = curval ;
- if ( n <= 0 )
- curval = fmemptr ;
- else {
-
- if ( writing && ( n <= 4 ) && ( n >= 2 ) && ( fontglue [ f ] != 0 ) )
- {
- deleteglueref ( fontglue [ f ] ) ;
- fontglue [ f ] = 0 ;
- }
- if ( n > fontparams [ f ] )
- if ( f < fontptr )
- curval = fmemptr ;
- else {
-
- do {
- if ( fmemptr == fontmemsize )
- overflow ( 677 , fontmemsize ) ;
- fontinfo [ fmemptr ] .cint = 0 ;
- incr ( fmemptr ) ;
- incr ( fontparams [ f ] ) ;
- } while ( ! ( n == fontparams [ f ] ) ) ;
- curval = fmemptr - 1 ;
- }
- else curval = n + parambase [ f ] ;
- }
- if ( curval == fmemptr )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 655 ) ;
- }
- printesc ( hash [ 3268 + f ] .v.RH ) ;
- print ( 673 ) ;
- printint ( fontparams [ f ] ) ;
- print ( 674 ) ;
- {
- helpptr = 2 ;
- helpline [ 1 ] = 675 ;
- helpline [ 0 ] = 676 ;
- }
- error () ;
- }
- }
- zscansomethinginterna ( level , negative )
- smallnumber level ;
- boolean negative ;
- {scansomethinginterna_regmem
- halfword m ;
- integer p ;
- m = curchr ;
- switch ( curcmd )
- {case 84 :
- {
- scansevenbitint () ;
- if ( m == 5139 )
- {
- curval = eqtb [ 5139 + curval ] .hh .v.RH ;
- curvallevel = 0 ;
- }
- else if ( m < 5139 )
- {
- curval = eqtb [ m + curval ] .hh .v.RH ;
- curvallevel = 0 ;
- }
- else {
-
- curval = eqtb [ m + curval ] .cint ;
- curvallevel = 0 ;
- }
- }
- break ;
- case 70 :
- case 71 :
- case 85 :
- case 86 :
- case 87 :
- if ( level != 5 )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 522 ) ;
- }
- {
- helpptr = 3 ;
- helpline [ 2 ] = 523 ;
- helpline [ 1 ] = 524 ;
- helpline [ 0 ] = 525 ;
- }
- backerror () ;
- {
- curval = 0 ;
- curvallevel = 1 ;
- }
- }
- else if ( curcmd <= 71 )
- {
- if ( curcmd < 71 )
- {
- scaneightbitint () ;
- m = 4066 + curval ;
- }
- {
- curval = eqtb [ m ] .hh .v.RH ;
- curvallevel = 5 ;
- }
- }
- else {
-
- backinput () ;
- scanfontident () ;
- {
- curval = 3268 + curval ;
- curvallevel = 4 ;
- }
- }
- break ;
- case 72 :
- {
- curval = eqtb [ m ] .cint ;
- curvallevel = 0 ;
- }
- break ;
- case 73 :
- {
- curval = eqtb [ m ] .cint ;
- curvallevel = 1 ;
- }
- break ;
- case 74 :
- {
- curval = eqtb [ m ] .hh .v.RH ;
- curvallevel = 2 ;
- }
- break ;
- case 75 :
- {
- curval = eqtb [ m ] .hh .v.RH ;
- curvallevel = 3 ;
- }
- break ;
- case 78 :
- if ( abs ( curlist .modefield ) != m )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 536 ) ;
- }
- printcmdchr ( 78 , m ) ;
- {
- helpptr = 4 ;
- helpline [ 3 ] = 537 ;
- helpline [ 2 ] = 538 ;
- helpline [ 1 ] = 539 ;
- helpline [ 0 ] = 540 ;
- }
- error () ;
- if ( level != 5 )
- {
- curval = 0 ;
- curvallevel = 1 ;
- }
- else {
-
- curval = 0 ;
- curvallevel = 0 ;
- }
- }
- else {
-
- curval = curlist .auxfield ;
- if ( m == 1 )
- curvallevel = 1 ;
- else curvallevel = 0 ;
- }
- break ;
- case 79 :
- {
- nest [ nestptr ] = curlist ;
- p = nestptr ;
- while ( abs ( nest [ p ] .modefield ) != 1 ) decr ( p ) ;
- {
- curval = nest [ p ] .pgfield ;
- curvallevel = 0 ;
- }
- }
- break ;
- case 81 :
- {
- if ( m == 0 )
- curval = deadcycles ;
- else curval = insertpenalties ;
- curvallevel = 0 ;
- }
- break ;
- case 80 :
- {
- if ( pagecontents == 0 )
- if ( m == 0 )
- curval = 1073741823L ;
- else curval = 0 ;
- else curval = pagesofar [ m ] ;
- curvallevel = 1 ;
- }
- break ;
- case 83 :
- {
- if ( eqtb [ 4056 ] .hh .v.RH == 0 )
- curval = 0 ;
- else curval = mem [ eqtb [ 4056 ] .hh .v.RH ] .hh .v.LH ;
- curvallevel = 0 ;
- }
- break ;
- case 82 :
- {
- scaneightbitint () ;
- if ( eqtb [ 4322 + curval ] .hh .v.RH == 0 )
- curval = 0 ;
- else curval = mem [ eqtb [ 4322 + curval ] .hh .v.RH + m ] .cint ;
- curvallevel = 1 ;
- }
- break ;
- case 67 :
- case 68 :
- {
- curval = curchr ;
- curvallevel = 0 ;
- }
- break ;
- case 76 :
- {
- findfontdimen ( false ) ;
- fontinfo [ fmemptr ] .cint = 0 ;
- {
- curval = fontinfo [ curval ] .cint ;
- curvallevel = 1 ;
- }
- }
- break ;
- case 77 :
- {
- scanfontident () ;
- if ( m == 0 )
- {
- curval = hyphenchar [ curval ] ;
- curvallevel = 0 ;
- }
- else {
-
- curval = skewchar [ curval ] ;
- curvallevel = 0 ;
- }
- }
- break ;
- case 88 :
- {
- scaneightbitint () ;
- switch ( m )
- {case 0 :
- curval = eqtb [ 5317 + curval ] .cint ;
- break ;
- case 1 :
- curval = eqtb [ 5721 + curval ] .cint ;
- break ;
- case 2 :
- curval = eqtb [ 3544 + curval ] .hh .v.RH ;
- break ;
- case 3 :
- curval = eqtb [ 3800 + curval ] .hh .v.RH ;
- break ;
- }
- curvallevel = m ;
- }
- break ;
- case 69 :
- {
- if ( curchr == 2 )
- curval = 0 ;
- else curval = 0 ;
- curvallevel = curchr ;
- if ( ! ( curlist .tailfield >= himemmin ) && ( curlist .modefield != 0 )
- )
- switch ( curchr )
- {case 0 :
- if ( mem [ curlist .tailfield ] .hh.b0 == 12 )
- curval = mem [ curlist .tailfield + 1 ] .cint ;
- break ;
- case 1 :
- if ( mem [ curlist .tailfield ] .hh.b0 == 11 )
- curval = mem [ curlist .tailfield + 1 ] .cint ;
- break ;
- case 2 :
- if ( mem [ curlist .tailfield ] .hh.b0 == 10 )
- {
- curval = mem [ curlist .tailfield + 1 ] .hh .v.LH ;
- if ( mem [ curlist .tailfield ] .hh.b1 == 99 )
- curvallevel = 3 ;
- }
- break ;
- }
- else if ( ( curlist .modefield == 1 ) && ( curlist .tailfield == curlist
- .headfield ) )
- switch ( curchr )
- {case 0 :
- curval = lastpenalty ;
- break ;
- case 1 :
- curval = lastkern ;
- break ;
- case 2 :
- if ( lastglue != 65535L )
- curval = lastglue ;
- break ;
- }
- }
- break ;
- default:
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 133 ) ;
- print ( 541 ) ;
- }
- printcmdchr ( curcmd , curchr ) ;
- print ( 542 ) ;
- printesc ( 395 ) ;
- {
- helpptr = 1 ;
- helpline [ 0 ] = 540 ;
- }
- error () ;
- if ( level != 5 )
- {
- curval = 0 ;
- curvallevel = 1 ;
- }
- else {
-
- curval = 0 ;
- curvallevel = 0 ;
- }
- }
- break ;
- }
- while ( curvallevel > level ) {
-
- if ( curvallevel == 2 )
- curval = mem [ curval + 1 ] .cint ;
- else if ( curvallevel == 3 )
- muerror () ;
- decr ( curvallevel ) ;
- }
- if ( negative )
- if ( curvallevel >= 2 )
- {
- curval = newspec ( curval ) ;
- {
- mem [ curval + 1 ] .cint = - (integer) mem [ curval + 1 ] .cint ;
- mem [ curval + 2 ] .cint = - (integer) mem [ curval + 2 ] .cint ;
- mem [ curval + 3 ] .cint = - (integer) mem [ curval + 3 ] .cint ;
- }
- }
- else curval = - (integer) curval ;
- else if ( ( curvallevel >= 2 ) && ( curvallevel <= 3 ) )
- incr ( mem [ curval ] .hh .v.RH ) ;
- }
-